package com.cqc.lite.service.impl;

import com.cqc.lite.dao.OrderDao;
import com.cqc.lite.domain.Orders;
import com.cqc.lite.service.OrdersService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OrdersServiceImpl implements OrdersService {


    private final OrderDao orderDao;
    @Autowired
    public OrdersServiceImpl(OrderDao orderDao){
        this.orderDao=orderDao;
    }
    @Override
    public List<Orders> findAll(Integer pageNum, Integer pageSize) throws Exception {
        PageHelper.startPage(pageNum,pageSize);
        return orderDao.findAll();
    }

    @Override
    public List<Orders> findAll() throws Exception {
        return null;
    }

    @Override
    public Orders findById(String id) throws Exception {
        return orderDao.findById(id);
    }
}
